// src/router/index.js
import { createRouter, createWebHashHistory } from "vue-router";
import Home from "../views/Home.vue";
import Data from "../views/Data.vue";
import User from '../views/User.vue';
import Login from '../views/Login.vue';
import Detail from "../views/Detail.vue";
import About from "../views/About.vue";
import Account from "../views/Account.vue";

// createRouter 创建路由实例
const router = createRouter({
  history: createWebHashHistory(), // hash 模式：createWebHashHistory，history 模式：createWebHistory
  routes: [
    {
      path: "/",
      redirect: "/Login",
    },
    {
      path: "/home",
      component: Home,
    },
    {
      path: "/data",
      component: Data,
    },
    {
      path: "/user",
      component: User,
    },
    {
      path: "/login",
      component: Login
    },
    {
      path: '/detail',
      component: Detail
    },
    {
      path: '/About',
      component: About
    },
    {
      path: '/Account',
      component: Account
    }

  ],
});

// 抛出路由实例, 在 main.js 中引用
export default router;